const sequelize = require("../database/index");

async function updateBorrowStatus(req, res, next) {
  const [result] = await sequelize.query(
    `
    UPDATE borrows 
    SET STATUS = 3 
    WHERE
      DATEDIFF( return_time, borrow_time ) > 60;
    `
  );
  console.log(result);
  res.status(200).json({
    msg: "更新成功",
  });
}
module.exports = { updateBorrowStatus };
